
    <template>
  <div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item label="销售单号" prop="orderid">
        <el-input v-model="formData.orderid" placeholder="请输入销售单号" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="销售员" prop="salesperson">
        <el-select v-model="formData.salesperson" placeholder="请选择销售员" clearable :style="{width: '100%'}">
          <el-option v-for="(item, index) in salespersonOptions" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="备注" prop="remarks">
        <el-input v-model="formData.remarks" type="textarea"  placeholder="请输入备注"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="状态" prop="state">
        <el-input v-model="formData.state" placeholder="请输入状态" clearable :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        orderid: undefined,
        salesperson: undefined,
        remarks: undefined,
        state: undefined,
      },
      rules: {
        orderid: [{
          required: true,
          message: '请输入销售单号',
          trigger: 'blur'
        }],
        salesperson: [{
          required: true,
          message: '请选择销售员',
          trigger: 'change'
        }],
        remarks: [{
          required: true,
          message: '请输入备注',
          trigger: 'blur'
        }],
        state: [{
          required: true,
          message: '请输入状态',
          trigger: 'blur'
        }],
      },
      salespersonOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>



<style lang="scss" scoped>
</style>